// 添加字幕相关的工具函数
export interface Subtitle {
    startTime: number;
    endTime: number;
    text: string;
}

export function formatTime(seconds: number): string {
    const pad = (num: number): string => num.toString().padStart(2, '0');
    const hours = Math.floor(seconds / 3600);
    const minutes = Math.floor((seconds % 3600) / 60);
    const secs = Math.floor(seconds % 60);
    
    return `${pad(hours)}:${pad(minutes)}:${pad(secs)}`;
}

export function parseSubtitleTime(timeString: string): number {
    const [hours, minutes, seconds] = timeString.split(':').map(Number);
    return hours * 3600 + minutes * 60 + seconds;
} 